package com.ejuornal.action;

import java.util.List;

import javax.annotation.Resource;

import com.ejuornal.bean.Role;
import com.ejuornal.service.RoleService;

public class RoleAction extends BaseAction<Role>{
	private static final long serialVersionUID = 745164287374889113L;
	private RoleService roleService;
	private Role role;
	private List<Role> roles;

	public String add() {
		roleService.add(role);
		return SUCCESS;
	}
	
	public String list() {
		roles = roleService.findAll();
		return SUCCESS;	
	}

	public RoleService getRoleService() {
		return roleService;
	}
	@Resource(name="roleService")
	public void setRoleService(RoleService roleService) {
		this.roleService = roleService;
	}
	
	public List<Role> getRoles() {
		return roles;
	}

	public void setRoles(List<Role> roles) {
		this.roles = roles;
	}

	public Role getRole() {
		return role;
	}

	public void setRole(Role role) {
		this.role = role;
	}
}
